(function () {
    return {
        initControl: function (oControl) {
            var v = oControl.value;
            v.datavar = 0;
            
        },
        compile: function (compileContext, doc, entity) {
            var cc = compileContext;
            var v = entity.value;
            var tc = cc.templateCoder;

            var dataName = cc.findDataName(doc,entity.value.datavar);


            if( dataName)
                cc.dataNames.push(dataName);

            if (dataName) {
                var editid = cc.newID();
                tc.add("<eui-page path=\"/ebfcontrol/form/simpleeditor/index\" params=\"value:" + dataName + ".value\" events=\"onChange:notifyRichEdit" + editid + "\"/>");
                cc.eventCoder.add("notifyRichEdit" + editid + ":function(value){" +
                    "this."+dataName+".value=value;"+
                    "}");
            } else {
                tc.add("<eui-page path=\"/ebfcontrol/form/simpleeditor/index\"/>");
            }


        }
    }
})();